<template>
	<view v-if="pageShow">
		<u-popup :show="show" @close="close">
			<view class="mainpadding dingwei">
				<view class="sanshier xiaohei fonweight textcenter margin_top">XXX场地邀你加入会员</view>
				<view class="xiahuaxian">
					<view class="ershiba xiaohei nofonweight textcenter margin_top2">您将享受以下权益 </view>
				</view>
				<view class="ershil xiaohei nofonweight textcenter margin_top4">优先订场</view>
				<view class="ershil xiaohei nofonweight textcenter margin_top4">订场优惠</view>
				<view class="margin_top6 ">
					<view class="flexleft">
						<view class="xiaocon margin_right1"></view>
						<u-icon class="margin_right1" name="checkmark-circle-fill" color="#E3C385" size="18"></u-icon>
						<view class="strongtext xiaohei nofonweight textcenter">同意XXX场地的会员规则</view>
					</view>
					<view class="huangbtnty margin_top2" @click="tzhyx">申请加入</view>
				</view>
				<image class="huiyuantb" src="../static/image/system/huiyuan.png" mode=""></image>
			</view>
		</u-popup>
		<!-- 场馆信息 -->
		<view class="dingwei">
			<image class="bannrcg" :src="dataAll.bg_image_text" mode=""></image>
			<view class="zyxxbox">
				<view class="xiaobai titletext fonweight">{{dataAll.name}}</view>
				<view class="xiaobai ershil nofonweight margin_top0">联系方式：{{dataAll.mobile}}</view>
				<view class="xiaobai ershil nofonweight margin_top0">联系地址：{{dataAll.cityinfo}}{{dataAll.address}}</view>
			</view>
		</view>
		<view class="" style="position: relative; top: -35rpx;">
			<!-- 会员 -->
			<!-- <view class="mainpadding ffffff blockhy">
				<view class="dingwei">
					<image class="huiytu" src="../static/image/system/huiyk.png" mode=""></image>
					<view class="flexbetween huner" @click="show = true">
						<view class="xiaoka fonweight ershiba">会员卡</view>
						<view class="kabtn">申请加入会员</view>
					</view>

				</view>
			</view> -->
			<!-- 详细介绍 -->
			<view class="mainpadding ffffff margin_top1">
				<view class="xiaohei fonweight sanshier">详细介绍</view>
				<view class="nofonweight xiaohui margin_top1">{{dataAll.des}}</view>
			</view>
			<!--活动列表  -->
			<view class="mainpadding ffffff margin_top1" v-if="hdList.length">
				<view class="flexbetween" @click="jumpurl('/pages_homepage/huodonglb?id=',listid)">
					<view class="xiaohei fonweight sanshier">活动列表</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
				<view class="xiahuaxian margin_top" v-for="item in hdList" :key="item.id" @click="tzjlbxq(item.id)">
					<view class="flexbetween">
						<view class="shilitu">
							<image :src="item.image_text" mode=""></image>
						</view>
						<view class="" style="width: 69%;">
							<view class="flexleft">
								<view class="xiaolhbtn margin_right1" v-if="item.activity_status==1">未开始</view>
								<view class="xiaocbtn margin_right1" v-if="item.activity_status==2">报名中</view>
								<view class="xiaolabtn margin_right1" v-if="item.activity_status==3">待	开赛</view>
								<view class="xiaojubtn margin_right1" v-if="item.activity_status==4">已开赛</view>
								<view class="xiaohbtn margin_right1" v-if="item.activity_status==5">赛事结束</view>
								<view class="titletext xiaohei fonweight yhxk">{{item.name}}</view>
							</view>
							<view class="strongtext xiaohui nofonweight margin_right2 margin_top1">开始时间：{{item.bm_starttime_text}}</view>
							<view class="strongtext xiaohui nofonweight margin_right2 margin_top1">结束时间：{{item.bm_endtime_text}}</view>
							<view class="strongtext xiaohui nofonweight margin_right2 yhxk margin_top1">{{item.cityinfo}}{{item.address}}</view>
						</view>
					</view>
				</view>
			</view>
			<!--  俱乐部比赛-->
			<view class="mainpadding ffffff margin_top1" v-if="bsList.length">
				<view class="flexbetween" @click="jumpurl('/pages_homepage/juleblb?id=',listid)">
					<view class="xiaohei fonweight sanshier">俱乐部比赛</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
				<!-- 活动-->
				<view class="xiahuaxian margin_top" v-for="item in bsList" :key="item.id" @click="tzxq(item.id)">
					<view class="flexbetween">
						<view class="shilitu">
							<image :src="item.image_text" mode=""></image>
						</view>
						<view class="" style="width: 69%;">
							<view class="flexleft">
								<!-- 1=未开始,2=报名中,3=待开赛,4=已开赛,5=赛事结束 -->
								<view class="xiaolhbtn margin_right1" v-if="item.ss_status==1">未开始</view>
								<view class="xiaocbtn margin_right1" v-if="item.ss_status==2">报名中</view>
								<view class="xiaolabtn margin_right1" v-if="item.ss_status==3">待开赛</view>
								<view class="xiaojubtn margin_right1" v-if="item.ss_status==4">已开赛</view>
								<view class="xiaohbtn margin_right1" v-if="item.ss_status==5">赛事结束</view>
								<view class="titletext xiaohei fonweight yhxk">{{item.name}}</view>
							</view>
							<view class="strongtext xiaohui nofonweight margin_right2 margin_top1">
								开始时间：{{item.bm_starttime_text}}</view>
							<view class="strongtext xiaohui nofonweight margin_right2 margin_top1">
								截至时间：{{item.bm_endtime_text}}</view>
							<view class="strongtext xiaohui nofonweight margin_right2 yhxk margin_top1">{{item.cityinfo}}{{item.address}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				show: false,
				dataAll:{},
				listid:"",
				pageShow:false,
				bsList:[],
				hdList:[]
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.getDetail()
			this.bsinit()
			this.hdinit()
		},
		methods: {
			getDetail(){
				httpRequest.request('/api/user/jlbDetail', 'GET', {
					user_zbfapply_id: this.listid
				}, false, false, true).then(res => {
					this.dataAll = res.data
					this.pageShow = true
				})
			},
			// 跳转赛事详情
			tzxq(id) {
				uni.navigateTo({
					url: '/pages_saishi/saishixq?id='+id
				})
			},
			bsinit() {
				let _this = this;
				let data = {
					page: 1,
					limit: 3,
					user_zbfapply_id:this.listid,
					ss_type:2
				}
				let url = '/api/sscl/ssIndex'
				httpRequest.request(url, 'GET', data, false, false, true).then(res => {
					if (res.code == 1) {
						this.bsList = res.data.data
					}
				})
			},
			hdinit() {
				let _this = this;
				let data = {
					page: 1,
					limit: 3,
					user_zbfapply_id:this.listid,
				}
				let url = '/api/Activitycl/activityIndex'
				httpRequest.request(url, 'GET', data, false, false, true).then(res => {
					if (res.code == 1) {
						this.hdList = res.data.data
					}
				})
			},
			// 跳转活动详情
			tzjlbxq(id) {
				uni.navigateTo({
					url: '/pages_julebu/huodongxq?id='+id
				})
			},
			jumpurl(url,id){
				uni.navigateTo({
					url:url+id
				})
			},
			// 跳转场地教练
			tzcdjl(){
				uni.navigateTo({
					url:'/pages_homepage/changdijiaol'
				})
			},
			// 跳转会员中心
			tzhyx(){
				uni.navigateTo({
					url:'/pages_homepage/huiyuanzx'
				})
			},
			close() {
				this.show = false
				// console.log('close');
			}
		}
	}
</script>

<style lang="scss" scoped>
	.sanzi {
		width: 85rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		text-align: center;
	}
	
	.huisebtn {
		width: 140rpx;
		height: 56rpx;
		background: #F5F5F5;
		border-radius: 28rpx 28rpx 28rpx 28rpx;
		font-size: 26rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #777777;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.lvsebtn {
		width: 140rpx;
		height: 56rpx;
		background: #1BA95B;
		border-radius: 28rpx 28rpx 28rpx 28rpx;
		font-size: 26rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.xiaolabtn {
		width: 80rpx;
		height: 40rpx;
		background: #078CE6;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		font-size: 20rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.xiaohbtn {
		width: 100rpx;
		height: 40rpx;
		background: #BAC3D5;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		font-size: 20rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #091636;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.xiaolhbtn {
		width: 80rpx;
		height: 40rpx;
		background: #1BA95B;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		font-size: 20rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.xiaojubtn {
		width: 80rpx;
		height: 40rpx;
		background: #F8B900;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		font-size: 20rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.xiaocbtn {
		width: 80rpx;
		height: 40rpx;
		background: #F76222;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		font-size: 20rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.xiaobtn{
		width: 120rpx;
		height: 56rpx;
		background: #1BA95B;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		font-size: 26rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.shilitu {
		width: 200rpx;
		height: 160rpx;
	
		image {
			width: 100%;
			height: 100%;
		}
	}
	
	.huibox{
		padding: 10rpx;
		background: #F9F9F9;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
	}
	.huiyuantb {
		width: 132rpx;
		height: 132rpx;
		position: absolute;
		top: -84rpx;
		left: 310rpx;
	}

	.xiaocon {
		width: 24rpx;
		height: 24rpx;
		background: #FFFFFF;
		border-radius: 50%;
		border: 2rpx solid #AAAAAA;
	}


	.jiaolt {
		width: 210rpx;
		height: 210rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.huner {
		position: absolute;
		bottom: 30rpx;
		right: 30rpx;
		width: 90%;
	}

	.kabtn {
		padding: 6rpx 20rpx 8rpx;
		background-color: #6A4B18;
		font-size: 24rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		border-radius: 30rpx;
	}

	.huiytu {
		height: 100rpx;
		width: 100%;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.blockhy {
		border-radius: 20rpx 20rpx 0rpx 0rpx;
	}

	page {
		background-color: #F9F9F9;
	}

	.zyxxbox {
		position: absolute;
		bottom: 60rpx;
		left: 30rpx;
	}
</style>